<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/include/taglibs.jsp"%>
<script language="javascript" type="text/javascript"
	src="scripts/tiny_mce/tiny_mce.js"></script>
<script language="javascript" type="text/javascript">
tinyMCE.init({
	mode : "textareas"
});
</script>

<div id="left">
<h2>收藏网摘:</h2>
<h3>${snippetForm.title}</h3>
<form:form commandName="snippetForm" name="snippetForm" method="post"
	action="saveSnippet.html">
	<table class="detail">
		<tr>
			<td>标题：</td>
			<td><form:input path="title" size="50" /></td>
		</tr>
		<tr>
			<td>地址：</td>
			<td><form:input path="url" size="50" /></td>
		</tr>
		<tr>
			<td>标签：</td>
			<td><input type="text" name="tagStr" value="" size="50" />
			您的tag<a href="javascript:refreshTag()">>></a>
			<div id="tags"></div>
			</td>
		</tr>
		<tr>
			<td>摘要：</td>
			<td><form:textarea path="descn" rows="15" cols="50" /></td>
		</tr>
		<tr>
			<td>是否私有：</td>
			<td><form:checkbox path="privateSnippet" /></td>
		</tr>

		<tr>
			<td>&nbsp;</td>
			<td align=center><input type="submit" class="button" name="save"
				value="收藏" /> <input type="button" class="button" name="cancel"
				value="返回" onclick="history.back(-1)" /></td>
		</tr>

	</table>


</form:form></div>
<script type='text/javascript'>
   function clickTag(tag){
         var s=$$("tagStr").value;
         var i=s.indexOf(tag);
         if(i>=0){
         	$$("tagStr").value=s.substring(0,i)+s.substring(i+s.length+1,s.length);
			
        }else{
        	$$("tagStr").value=s+" "+tag;

        	}
   }
  
    function refreshTag()
    {
       $("#tags").html("载入中...");
       $("#tags").load("listFansTag.ajax");
    }
</script>

<div id="right">
<div class=sbjtd>提示：输入您认为的标签，<b>用空格分隔多个标签</b>，用空格分隔，就会将此链接摘录到您相应标签下<br>
小技巧：标签也就是Tag，是为了您方便的管理网摘，并在社区内更方便的与他人分享。建议标签简洁常用，比如spring，hibernate，ajax等，避免使用较长的标签</div>
</div>

<script type="text/javascript">
    document.forms["snippetForm"].elements["tagStr"].focus();
</script>

